package org.alive.test.deadlock;


/**
 * Update task. TB0001 & TB0010, TB1003
 * 
 * @author XUHAILIN730
 * 
 */
public class UpdateTask implements Runnable {

	private TaskDAO dao = new TaskDAO();

	public void run() {
		while (true) {

			String acctNo = dao.getAvaliableAcctNo(1);
			// dao.insertCustAndAcct(acctNo);
			int result = dao.updateAcct(acctNo);
			StringBuffer sbMsg = new StringBuffer();
			sbMsg.append(Thread.currentThread().getName());
			sbMsg.append(" Done(Update) acctNo = ").append(acctNo)
					.append(" result = ").append(result);
			System.out.println(sbMsg.toString());
		}
	}
}
